<?php

/**
 * institucionEmpresa filter form base class.
 *
 * @package    sistema_itec_new
 * @subpackage filter
 * @author     Your name here
 * @version    SVN: $Id: sfDoctrineFormFilterGeneratedTemplate.php 29570 2010-05-21 14:49:47Z Kris.Wallsmith $
 */
abstract class BaseinstitucionEmpresaFormFilter extends BaseFormFilterDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'nombre'                => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'etiqueta'              => new sfWidgetFormFilterInput(),
      'observaciones'         => new sfWidgetFormFilterInput(),
      'domicilio'             => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'telefono_fijo'         => new sfWidgetFormFilterInput(),
      'telefono_fax'          => new sfWidgetFormFilterInput(),
      'cuit'                  => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'email'                 => new sfWidgetFormFilterInput(),
      'institucion_educativa' => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'propia'                => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'sitio_web'             => new sfWidgetFormFilterInput(),
      'rubro_id'              => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('Rubro'), 'add_empty' => true)),
      'gestion_id'            => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('Gestion'), 'add_empty' => true)),
      'localidad_id'          => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('Localidad'), 'add_empty' => true)),
      'estado_id'             => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('Estado'), 'add_empty' => true)),
    ));

    $this->setValidators(array(
      'nombre'                => new sfValidatorPass(array('required' => false)),
      'etiqueta'              => new sfValidatorPass(array('required' => false)),
      'observaciones'         => new sfValidatorPass(array('required' => false)),
      'domicilio'             => new sfValidatorPass(array('required' => false)),
      'telefono_fijo'         => new sfValidatorPass(array('required' => false)),
      'telefono_fax'          => new sfValidatorPass(array('required' => false)),
      'cuit'                  => new sfValidatorPass(array('required' => false)),
      'email'                 => new sfValidatorPass(array('required' => false)),
      'institucion_educativa' => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'propia'                => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'sitio_web'             => new sfValidatorPass(array('required' => false)),
      'rubro_id'              => new sfValidatorDoctrineChoice(array('required' => false, 'model' => $this->getRelatedModelName('Rubro'), 'column' => 'id')),
      'gestion_id'            => new sfValidatorDoctrineChoice(array('required' => false, 'model' => $this->getRelatedModelName('Gestion'), 'column' => 'id')),
      'localidad_id'          => new sfValidatorDoctrineChoice(array('required' => false, 'model' => $this->getRelatedModelName('Localidad'), 'column' => 'id')),
      'estado_id'             => new sfValidatorDoctrineChoice(array('required' => false, 'model' => $this->getRelatedModelName('Estado'), 'column' => 'id')),
    ));

    $this->widgetSchema->setNameFormat('institucion_empresa_filters[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    $this->setupInheritance();

    parent::setup();
  }

  public function getModelName()
  {
    return 'institucionEmpresa';
  }

  public function getFields()
  {
    return array(
      'id'                    => 'Number',
      'nombre'                => 'Text',
      'etiqueta'              => 'Text',
      'observaciones'         => 'Text',
      'domicilio'             => 'Text',
      'telefono_fijo'         => 'Text',
      'telefono_fax'          => 'Text',
      'cuit'                  => 'Text',
      'email'                 => 'Text',
      'institucion_educativa' => 'Number',
      'propia'                => 'Number',
      'sitio_web'             => 'Text',
      'rubro_id'              => 'ForeignKey',
      'gestion_id'            => 'ForeignKey',
      'localidad_id'          => 'ForeignKey',
      'estado_id'             => 'ForeignKey',
    );
  }
}
